﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YasharEl.Infrastructure.Core.Applications;
using YasharEl.Infrastructure.EntityModel;

namespace YasharEl.Infrastructure.ProcessEngine.EntityModel
{
    public class ProcessDefinitionGroupEntity : ReadOnlyEntity, IProcessDefinitionGroup
    {
        #region Constructors

        public ProcessDefinitionGroupEntity()
        {
            ChildGroups = new List<IProcessDefinitionGroup>();
            GroupedDefinitions = new List<IProcessDefinition>();
        }

        #endregion

        #region IProcessDefinitionGroup Members

        public virtual long ProcessDefinitionGroupId
        {
            get;
            protected set;
        }

        public virtual string GroupName
        {
            get;
            protected set;
        }

        public virtual string GroupDescription
        {
            get;
            protected set;
        }

        public virtual IProcessDefinitionGroup ParentGroup
        {
            get;
            protected set;
        }

        public virtual IList<IProcessDefinitionGroup> ChildGroups
        {
            get;
            protected set;
        }

        public virtual IList<IProcessDefinition> GroupedDefinitions
        {
            get;
            protected set;
        }

        public virtual IApplication BelongsToApplication
        {
            get;
            protected set;
        }

        #endregion

        #region AbstractEntity<TIdentity> Overrides

        public override long Id
        {
            get
            {
                return ProcessDefinitionGroupId;
            }
            protected set
            {
                ProcessDefinitionGroupId = value;
            }
        }

        #endregion
    }
}
